package org.casper.web;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.casper.mail.SendMail;

/**
 * Servlet implementation class RegisterServlet
 */
public class RegisterServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		String mail = request.getParameter("mail");
		System.out.println(mail);
		new SendMail(mail).start();
		request.getSession().setAttribute("message", mail+"注册成功，请及时查看邮箱邮件，进行用户激活");
		response.sendRedirect("message.jsp");
	}
       
	

}
